home *** CD-ROM | disk | FTP | other *** search
- /* DirParseCommon.c */
- /*
- * DirParseCommon.c
- * Copyright © 1992-93 Apple Computer Inc. All Rights Reserved.
- *
- * This is the "entrance" to the difficult parse routines. It places the parameter
- * block into the request queue and, if the queue had been empty, calls the
- * process procedure. If this is a synchronous request, DirParseCommon stalls
- * here until the request completes.
- */
- #include "DTSSampleCSAM.h"
-
- void
- DirParseCommon(
- register DTSSampleCSAMInfoPtr infoPtr,
- register DirParamBlockPtr pb,
- Boolean async
- )
- {
- short saveSR;
-
- STATUS = ioBusy;
- /*
- * If the queue is empty, just call the command processor. Otherwise, add
- * this request to the queue of things that need processing. Locking out
- * interrupts prevents a statistically-unlikely race condition where the
- * queue contents change out from under us.
- */
- /***/ saveSR = DisableInterrupts();
- /***/ if (INFO.requestQueueHdr.qHead == NULL) {
- /***/ EnableInterrupts(saveSR);
- ProcessPDCommands(infoPtr, pb, async);
- }
- /***/ else {
- /***/ Enqueue((QElemPtr) pb, &INFO.requestQueueHdr);
- /***/ EnableInterrupts(saveSR);
- }
- if (async == FALSE) {
- /*
- * Synchronous request. Stall until the request completes. On a real
- * operating system, we would call a real "reschedule" routine.
- */
- LogStatus('DiPC', STATUS, "\pSynchronous stall");
- while (STATUS == ioBusy)
- ;
- }
- LogStatus('DiPC', STATUS, "\pDirParseCommon exit status");
- }
-
-
-
-
-
-